import pygame, os, sys


class Background(pygame.sprite.Sprite):
  def __init__(self):
    pygame.sprite.Sprite.__init__(self)
    self.image, self.rect = load_image('bg4.jpg')

def load_image(name, colorkey=None):
	fullname= os.path.join('images', name)
	#imgFile, headers = urllib.urlretrieve('http://pixelbud.com/images/twitter_bird_small.gif')
	#print imgFile
	try:
		image = pygame.image.load(fullname)
		#image = pygame.image.load(imgFile)
	except pygame.error, message:
		print 'Cannot load image:', fullname
		#print 'Cannot load image:', message
		raise SystemExit, message
	image = image.convert()
	if colorkey is not None:
		if colorkey is -1:
			colorkey = image.get_at((0,0))
			image.set_colorkey(colorkey, RLEACCEL)
	return image, image.get_rect()
